package com.ruoyi.culture.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.culture.mapper.CultureLeaveMessageMapper;
import com.ruoyi.culture.domain.CultureLeaveMessage;
import com.ruoyi.culture.service.ICultureLeaveMessageService;

/**
 * 留言Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-27
 */
@Service
public class CultureLeaveMessageServiceImpl implements ICultureLeaveMessageService 
{
    @Autowired
    private CultureLeaveMessageMapper cultureLeaveMessageMapper;

    /**
     * 查询留言
     * 
     * @param id 留言主键
     * @return 留言
     */
    @Override
    public CultureLeaveMessage selectCultureLeaveMessageById(Long id)
    {
        return cultureLeaveMessageMapper.selectCultureLeaveMessageById(id);
    }

    /**
     * 查询留言列表
     * 
     * @param cultureLeaveMessage 留言
     * @return 留言
     */
    @Override
    public List<CultureLeaveMessage> selectCultureLeaveMessageList(CultureLeaveMessage cultureLeaveMessage)
    {
        return cultureLeaveMessageMapper.selectCultureLeaveMessageList(cultureLeaveMessage);
    }

    /**
     * 新增留言
     * 
     * @param cultureLeaveMessage 留言
     * @return 结果
     */
    @Override
    public int insertCultureLeaveMessage(CultureLeaveMessage cultureLeaveMessage)
    {
        cultureLeaveMessage.setCreateTime(DateUtils.getNowDate());
        return cultureLeaveMessageMapper.insertCultureLeaveMessage(cultureLeaveMessage);
    }

    /**
     * 修改留言
     * 
     * @param cultureLeaveMessage 留言
     * @return 结果
     */
    @Override
    public int updateCultureLeaveMessage(CultureLeaveMessage cultureLeaveMessage)
    {
        cultureLeaveMessage.setUpdateTime(DateUtils.getNowDate());
        return cultureLeaveMessageMapper.updateCultureLeaveMessage(cultureLeaveMessage);
    }

    /**
     * 批量删除留言
     * 
     * @param ids 需要删除的留言主键
     * @return 结果
     */
    @Override
    public int deleteCultureLeaveMessageByIds(Long[] ids)
    {
        return cultureLeaveMessageMapper.deleteCultureLeaveMessageByIds(ids);
    }

    /**
     * 删除留言信息
     * 
     * @param id 留言主键
     * @return 结果
     */
    @Override
    public int deleteCultureLeaveMessageById(Long id)
    {
        return cultureLeaveMessageMapper.deleteCultureLeaveMessageById(id);
    }
}
